﻿<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="Equipment.DataAccess" %>
<fieldset>
    <legend>User</legend>
    <table>
        <tr>
            <td width="130px">
                Site:
            </td>
            <td>
                <%= Html.DropDownList("UserSite")%>
                <%= Html.Hidden("currUserID", DirectCast(ViewData("CurrentUser"), User).ID)%>
                <%= Html.Hidden("currSiteID", DirectCast(ViewData("CurrentUser"), User).SiteID)%>
            </td>
        </tr>
        <tr>
            <td width="130px">
                Status:
            </td>
            <td>
                <%= Html.RadioButton("rbUserActive", True, CBool(DirectCast(ViewData("CurrentUser"), User).IsActive))%>&nbsp;Active&nbsp;&nbsp;&nbsp;
                <%= Html.RadioButton("rbUserActive", False, Not CBool(DirectCast(ViewData("CurrentUser"), User).IsActive))%>&nbsp;Inactive
            </td>
        </tr>
        <tr>
            <td>
                First Name:
            </td>
            <td>
                <%= Html.TextBox("firstName", DirectCast(ViewData("CurrentUser"), User).FirstName, New With {.class = "text"})%>
            </td>
        </tr>
        <tr>
            <td>
                Last Name:
            </td>
            <td>
                <%= Html.TextBox("lastName", DirectCast(ViewData("CurrentUser"), User).LastName, New With {.class = "text"})%>
            </td>
        </tr>
        <tr>
            <td>
                User Name:
            </td>
            <td>
                <%= Html.TextBox("userName", DirectCast(ViewData("CurrentUser"), User).Username, New With {.class = "text unique-username"})%>
            </td>
        </tr>
        <tr>
            <td>
                Email:
            </td>
            <td>
                <%= Html.TextBox("email", DirectCast(ViewData("CurrentUser"), User).Email, New With {.class = "text unique-email"})%>
            </td>
        </tr>
        <tr>
            <td>
                Password:
            </td>
            <td>
                <%= Html.Password("password", DirectCast(ViewData("CurrentUser"), User).Password, New With {.class = "text"})%>
            </td>
        </tr>
        <tr>
            <td>
                Confirm Password:
            </td>
            <td>
                <%= Html.Password("confirmPassword", DirectCast(ViewData("CurrentUser"), User).Password, New With {.class = "text"})%>
            </td>
        </tr>
        <tr>
            <td class="top">
                Security Roles:
            </td>
            <td id="selectionRoleContent">
                <% Html.RenderPartial("~/Views/User/Controls/RoleSelectionGrid.ascx")%>
            </td>
        </tr>
        <tr>
            <td class="top">
                User Group:
            </td>
            <td id="selectionGroupContent">
                <% Html.RenderPartial("~/Views/User/Controls/GroupSelectionGrid.ascx")%>
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <input id="btnSaveRole" type="submit" class="button" style="width: 80px;" value="Save"/>
                &nbsp;&nbsp;
                <input id="btnCancel" type="submit" class="button" style="width: 80px;" value="Cancel"
                    onclick="javascript:cancel(); return false;" />
            </td>
        </tr>
    </table>
</fieldset>
<br />
<div class="section-separator"></div>
<br />
<br />